
#PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${PROJECT_SOURCE_DIR}/srp_auth.proto)

include_directories( ${CMAKE_CURRENT_BINARY_DIR} )

protoc_cpp(PROTO_SRCS PROTO_HDRS ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/srp_auth.proto)

add_library(pam_srp SHARED pam_srp.hpp 
                           pam_srp.cpp 
                           srp.c 
                           pam_srp_net.cpp 
                           pam_srp_settings.cpp
                           pam_srp_cache.cpp      
                           sqlite_cxx.hpp
                          ${PROTO_SRCS} )

set_target_properties(pam_srp PROPERTIES PREFIX "")

target_link_libraries(pam_srp pam boost_system ssl pthread sqlite3 ${PROTOBUF_LIBRARY})

install(TARGETS pam_srp DESTINATION ${PLUGIN_DIR})
#if ( CMAKE_SIZE_OF_VOID_P GREATER 4 )
#  install(TARGETS pam_srp DESTINATION lib/security)
#else ( CMAKE_SIZE_OF_VOID_P GREATER 4 )
#  install(TARGETS pam_srp DESTINATION lib64/security)
#endif ( CMAKE_SIZE_OF_VOID_P GREATER 4 )